import asyncio

import ccxt.async_support as ccxt

class BitGetExchange(object):
    def __init__(self):
        self.bitget = ccxt.bitget({
        'apiKey': 'bg_8900291ab3e3d1cc7f15314ecdc1ae41',
        'secret': 'cd84ef99b2a4b9df61aa5a1f7fd2c3320af1186227760b99f3cf2c4cb928b159',
    })

    async def get_service_time(self):
        resp =  await self.bitget.fetch_time()
        print(resp)

    async def get_trade_rate(self):
        resp = await self.bitget.fetch_trading_fee(symbol='BTCUSDT', params={
            "businessType": "mix"
        })
        print(resp)

    async def fetch_balance(self):
        resp = await self.bitget.fetch_balance()
        print(resp)

async def main():
    exchange = BitGetExchange()
    await exchange.fetch_balance()
    await exchange.bitget.close()

if __name__ == '__main__':
    asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
    asyncio.run(main())



